/*
 * @Description: 
 * @Author: yeeChen
 * @Date: 2022-12-21 15:50:20
 * @LastEditTime: 2022-12-21 15:53:44
 * @LastEditors: yeeChen
 */
const express = require('express')
const app = express()


app.get('/', (req, res) => {
    throw new Error('服务器内部报错')
    res.send('Home page')
})

app.use((err, req, res, next) => {
    console.log('发生了错误' + err.message);
    res.send('Error:'+err.message)
    next()
})

app.listen(80, () => {
    console.log('express running at http://127.0.0.1');
})